package org.yxing.palpalgps.models;

/**
 * user model
 * @author yuxing
 *
 */
public class User {
    public static final String KEY_ID = "id";
    public static final String KEY_UID = "uid";
    public static final String KEY_NAME = "name";
    public static final String KEY_EMAIL = "email";
    public static final String KEY_GENDER = "gender";
    public static final String KEY_FACE = "picture";
    public static final String KEY_BIRTHDAY = "birthday";
    public static final String KEY_INTEREST = "interest";
    public static final String KEY_RELATION = "relation";
    public static final String KEY_DISTANCE = "distance";
    
    private String id;
    
    private String name;
    
    private String email;
    
    private String gender;
    
    private String face;
    
    private String birthday;
    
    private String interest;
    
    private int relation = 0;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
 
    public void setGender(String gender) {
        this.gender = (gender.toLowerCase().startsWith("m")) ? "m": "f";
    }
    
    public String getGender() {
        return gender;
    }
    
    public void setFace(String face) {
        this.face = face;
    }
    
    public String getFace() {
        return face;
    }
    
    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }
    
    public String getBirthday() {
        return birthday;
    }
    
    public int getRelation() {
        return relation;
    }
    
    public void setRelation(int relation) {
        this.relation = relation;
    }
    
    public void setRelation(String relation) {
        this.relation = (relation == null || relation.length() < 5) ? 0 : Integer.parseInt(relation);
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getInterest() {
        return interest;
    }

    public void setInterest(String interest) {
        this.interest = interest;
    }
}
